package com.easyj.admin.db.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *   @title 权限
 *   @remark 由路由表和铵钮权限组成，前端根据路由生成菜单
 *   @table b_permission
 *   @primaryKey id
 *   @enablePage false
 */
public class Permission implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *   @title ID
     *   @remark 
     *   @column id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long id;

    /**
     *   @title 组件功能名称
     *   @remark 唯一
     *   @column name
     *   @dataType VARCHAR
     *   @length 30
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String name;

    /**
     *   @title 菜单标题
     *   @remark 
     *   @column title
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String title;

    /**
     *   @title 组件
     *   @remark 
     *   @column component
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String component;

    /**
     *   @title 上级菜单ID
     *   @remark 0为第一级
     *   @column pid
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long pid;

    /**
     *   @title 排序
     *   @remark 
     *   @column sort
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType BIGINT
     */
    private Long sort;

    /**
     *   @title 图标
     *   @remark 
     *   @column icon
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String icon;

    /**
     *   @title 链接地址
     *   @remark 
     *   @column path
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String path;

    /**
     *   @title 重定向
     *   @remark 
     *   @column redirect
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String redirect;

    /**
     *   @title 
     *   @remark 
     *   @column cache
     *   @dataType BIT
     *   @length 1
     *   @scale 0
     *   @nullable true
     *   @jdbcType BIT
     */
    private Boolean cache;

    /**
     *   @title 
     *   @remark 
     *   @column iframe
     *   @dataType BIT
     *   @length 1
     *   @scale 0
     *   @nullable true
     *   @jdbcType BIT
     */
    private Boolean iframe;

    /**
     *   @title 
     *   @remark 
     *   @column permission
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String permission;

    /**
     *   @title 隐藏标记
     *   @remark 1：表示左侧菜单不可见
     *   @column hidden
     *   @dataType BIT
     *   @length 1
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIT
     */
    private Boolean hidden;

    /**
     *   @title 类型 
     *   @remark 1：路由（菜单/组件） ，2：按钮。如果是：1，则path不能为空
     *   @column type
     *   @dataType INT
     *   @length 10
     *   @scale 0
     *   @nullable false
     *   @jdbcType INTEGER
     */
    private Integer type;

    /**
     *   @title 删除标记
     *   @remark 
     *   @column deleted
     *   @dataType BIT
     *   @length 1
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIT
     */
    private Boolean deleted;

    /**
     *   @title 创建日期
     *   @remark 
     *   @column create_time
     *   @dataType DATETIME
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType TIMESTAMP
     */
    private Date createTime;

    /**
     *   @title 
     *   @remark 
     *   @column modify_time
     *   @dataType DATETIME
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType TIMESTAMP
     */
    private Date modifyTime;

    /**
     *   @title 
     *   @remark 
     *   @column operator_id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable true
     *   @jdbcType BIGINT
     */
    private Long operatorId;
    
    private List<Permission> children;
    
    

    public List<Permission> getChildren() {
		return children;
	}

	public void setChildren(List<Permission> children) {
		this.children = children;
	}

	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getRedirect() {
        return redirect;
    }

    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }

    public Boolean getCache() {
        return cache;
    }

    public void setCache(Boolean cache) {
        this.cache = cache;
    }

    public Boolean getIframe() {
        return iframe;
    }

    public void setIframe(Boolean iframe) {
        this.iframe = iframe;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public Boolean getHidden() {
        return hidden;
    }

    public void setHidden(Boolean hidden) {
        this.hidden = hidden;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Long getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Long operatorId) {
        this.operatorId = operatorId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Permission other = (Permission) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", title=").append(title);
        sb.append(", component=").append(component);
        sb.append(", pid=").append(pid);
        sb.append(", sort=").append(sort);
        sb.append(", icon=").append(icon);
        sb.append(", path=").append(path);
        sb.append(", redirect=").append(redirect);
        sb.append(", cache=").append(cache);
        sb.append(", iframe=").append(iframe);
        sb.append(", permission=").append(permission);
        sb.append(", hidden=").append(hidden);
        sb.append(", type=").append(type);
        sb.append(", deleted=").append(deleted);
        sb.append(", createTime=").append(createTime);
        sb.append(", modifyTime=").append(modifyTime);
        sb.append(", operatorId=").append(operatorId);
        sb.append("]");
        return sb.toString();
    }
}